/**
 * FlightInfoDbTestSuite.java
 * Jan 15, 2010
 */
package com.dlplay.flightinfo.test;

import java.util.List;
import java.util.logging.Logger;

import org.junit.Test;

import com.dlplay.flightinfo.core.FlightSystem;
import com.dlplay.flightinfo.data.Airport;
import com.dlplay.flightinfo.data.AirportTerminalCode;

/**
 * @author zhang yu
 *
 */
public class AirportMngrTestSuite extends AbstractGaeTestSuite {
	
	@Test
	public void testExample() {		
		log.info("AirportMngrTestSuite");
		Airport airport_T3 = FlightSystem.getAirportManager().getAirport(AirportTerminalCode.PEK_T3);
		if(airport_T3==null)
		{
			log.info("no T3 Found");
		}
		else
		{
			log.info("found: "+airport_T3);
		}
		airport_T3 = new Airport(AirportTerminalCode.PEK_T3);
		airport_T3.setLocation("Beijing");
		FlightSystem.getAirportManager().updateAirport(airport_T3);
		airport_T3 = FlightSystem.getAirportManager().getAirport(AirportTerminalCode.PEK_T3);
		if(airport_T3==null)
		{
			log.info("no T3 Found");
		}
		else
		{
			log.info("found: "+airport_T3);
		}
		List<Airport> airports = FlightSystem.getAirportManager().getAirportList();
		for(Airport airport:airports)
		{
			log.info("airport: "+airport);
		}
	}

}
